<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ page import="weaver.hrm.HrmUserVarify"%>
<%@ page import="weaver.hrm.User"%>
<%@ page import="weaver.general.*" %>
<%@ page import="weaver.general.Util" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<%@ page import="java.net.URLDecoder"%>
<%
User user = HrmUserVarify.getUser (request , response) ;
if(user == null)  return ;
int userId =  user.getUID();
//获取frcode码 根据既有逻辑判断对应的报表
int id = Util.getIntValue(request.getParameter("id"),0);
int subcompanyid1 = user.getUserSubCompany1();
String sfrUrl = "http://123.57.205.50:8075/WebReport/ReportServer?reportlet=";

String sfrSrc = "";//iframe超链接地址
String sfrTitle = "周单项业务总量前十";//报表名称
String isiframe = "";//是否本页面iframe打开
//帆软报表的路径
sfrSrc = "ecology/zhoubao/zhoubao_zongliangqianshitu.cpt";
sfrUrl = sfrUrl+sfrSrc+"&subcompanyid1="+subcompanyid1;
if(!"0".equals(isiframe)){
	response.sendRedirect(sfrUrl);
	return;
}
%>
<!DOCTYPE html>   
<html>       
<head>       
<title><%=sfrTitle%></title>       
<script type="text/javascript"> 
var sfrSrc = "<%=sfrSrc%>";
if(sfrSrc==""){
	alert("无法正确解析找到相应的帆软报表文件,请不要修改地址栏的参数")
	window.close();
}
//cjkEncode方法的实现代码，放在网页head中或者用户自己的js文件中  
var sfrUrl = "<%=sfrUrl%>";
function cjkEncode(text) {                                                                             
  if (text == null) {          
    return "";          
  }          
  var newText = "";          
  for (var i = 0; i < text.length; i++) {          
    var code = text.charCodeAt (i);           
    if (code >= 128 || code == 91 || code == 93) {  //91 is "[", 93 is "]".          
      newText += "[" + code.toString(16) + "]";          
    } else {          
      newText += text.charAt(i);          
    }          
  }          
  return newText;          
}      
function autoLoad() {  
  var addr = cjkEncode(sfrUrl);   
  //var addr = sfrUrl;   
  document.getElementById("reportFrame").src = addr;   
}   
window.onload = autoLoad; 
</script>       
</head>       
<body style="margin:0px;">        
<iframe id="reportFrame"  src="" style="width:100%;height:800px;" ></iframe>       
</body>       
</html> 